<template>
	<div class="visual_box">
		<div class="visual_title">
			故障信息
		</div>
		<dv-scroll-board :config="config_msg" style="width:155%" :style="{ height: chartHeightSize }"/>
	</div>
</template>
<script>
import api from "@/api/api";
export default {
	props: {
		chartHeightSize: {
			type: [Number, String],
			default: "",
		},
	},
	data() {
		return {
			config_msg: {
				header: ["时间", "设备", "故障"],
				headerBGC: "transparent",
				oddRowBGC: "transparent",
				evenRowBGC: "transparent",
				rowNum: 10,
				data: [],
			},
		};
	},
	created() {
		this.getData();
	},
	methods: {
		getData() {
			var _this = this;
			setTimeout(() => {
				_this.getData();
			}, 360000);
			api
				.faultMsg()
				.then((res) => {
					var data = res.data.data;
					data.forEach((item, index) => {
							this.config_msg.data[index] = [
							item.startime,
							item.dev_name_cn,
							item.alarmname.split(',')[0],
						];
					});
					this.config_msg = { ...this.config_msg };
				});
		},
		formt(value) {
			// var date = new Date(value);
			// var year = date.getFullYear()
			// var
			// var hour = date.getHours();
			// var minutes = date.getMinutes();
			// var seconds = date.getSeconds();
			// return hour + ":" + minutes + ":" + seconds;

		},
	},
};
</script>
<style lang="scss">
// .dv-scroll-board .rows .ceil{
// 	font-size: 12px !important;
// 	padding: 10px;
// }

</style>
